package cn.itcast.order;


import cn.itcast.feign.client.UserClient;
import cn.itcast.feign.config.DefaultFeignConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;



@MapperScan("cn.itcast.order.mapper")
@SpringBootApplication
//@FeignClient(value = "userservice", configuration = DefaultFeignConfig .class) // 局部生效
@EnableFeignClients(clients = UserClient.class,    // 全局生效
        defaultConfiguration = DefaultFeignConfig.class)
public class OrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }

/*    // 注册RestTemplate实例
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

    // 定义IRule实现可以修改负载均衡规则
    @Bean
    public IRule randomRule(){
        return new RandomRule();
    }*/

}